from selenium.webdriver.common.by import By
from unit__003.unit_04.Page.Page import Page

class Page1(Page):

    # 1.悬浮-我的酒仙 href="https://member.jiuxian.com/index.htm"
    f_loc=(By.XPATH,'//a[@href="https://member.jiuxian.com/index.htm"]')
    def xf_move_to(self):
        self.move_to_element(self.f_loc)
    # 2.点击我的订单 我的订单
    myorder=(By.LINK_TEXT,'我的订单')
    def click_myorder(self):
        self.click(self.myorder)
    # 窗口切换
    def change_window(self):
        self.new_window()
    # 向下滚动
    def in_scrollTo(self):
        self.scrollTo_x('500')
    # 3.点击收货地址 /html/body/div[5]/div[2]/div[2]/div[4]/a[3]/span
    address_loc=(By.XPATH,'/html/body/div[5]/div[2]/div[2]/div[4]/a[3]/span')
    def click_address(self):
        self.click(self.address_loc)
    # 4.点击删除 class="controlRemove"
    delete_loc=(By.CLASS_NAME,'controlRemove')
    def click_delete(self):
        self.click(self.delete_loc)
    # 5.点击确定 /html/body/div[8]/div/div[3]/span[1]/b
    queding_loc=(By.XPATH,'/html/body/div[8]/div/div[3]/span[1]/b')
    def click_quedingdz(self):
        self.click(self.queding_loc)
    # 6.再次点击确定 /html/body/div[8]/div/div[3]/span[1]/b
    queding2_loc=(By.XPATH,'/html/body/div[8]/div/div[3]/span[1]/b')
    def click_queding2(self):
        self.click(self.queding2_loc)
    # 7.输入收货人 id="people"
    sh_people = (By.ID,'people')
    def sr_shpeople(self):
        self.send_keys(self.sh_people,'小婷')
    # 8.选择省份 id="province"
    province_loc=(By.ID,'province')
    def select_province(self):
        self.select_index(self.province_loc,1)
    # 9.选择市  id="city"
    city_loc=(By.ID,'city')
    def select_city(self):
        self.select_value(self.city_loc,'52')
    # 10.选择区 id="district"
    district_loc=(By.ID,'district')
    def select_district(self):
        self.select_visble_text(self.district_loc,'昌平区')
    # 11.输入详细地址 name="addressMore"
    xxdz_loc=(By.NAME,'addressMore')
    def sr_xxdz(self):
        self.send_keys(self.xxdz_loc,'南口南大街21号')
    # 12.输入编码 input id="zipcode" name="zipcode"
    bm_loc=(By.XPATH,'//input[@id="zipcode" or @name="zipcode"]')
    def sr_bm(self):
        self.send_keys(self.bm_loc,'100001')
    # 13.输入手机号 id="iphone"
    sjh_loc=(By.ID,'iphone')
    def sr_sjh(self):
        self.send_keys(self.sjh_loc,'18185603008')
    # 14.输入固定电话 id="phone"
    sr_phone=(By.ID,'phone')
    def sr_gdphone(self):
        self.send_keys(self.sr_phone,'18185603008')
    # 15.点击提交 class="qjwSubmit2"
    conmit_loc=(By.CLASS_NAME,'qjwSubmit2')
    def click_conmit(self):
        self.click(self.conmit_loc)

    # 16.点击确定
    queding3_loc=(By.XPATH,'/html/body/div[8]/div/div[3]/span[1]')
    def click_queding3(self):
        self.click(self.queding3_loc)


